home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-06-22 | 1.3 KB | 73 lines | [TEXT/MPS ] |
-
- {The CurProcResid function is assembly}
- {code which returns the 4BND resource}
- {number.}
-
- function CurProcResid:Integer;
- INLINE $3EAD, $DE4E;
-
- function GetResNum(T:ResType; Localid:Integer):Integer; FORWARD;
- {
- .
- . Your code here
- .
- }
-
- {Pass GetResNum the resource type and}
- {the local id and it will return the}
- {global id.}
-
- function GetResNum;
-
- type
-
- ResEntry = record
- Typ:ResType;
- LocalNum, GlobalNum:Integer;
- end;
- ResTab = record
- nbEntry:Integer;
- Tab:array[1..1] of ResEntry;
- end;
- ResTabPtr = ^ResTab;
- ResTabHandle = ^ResTabPtr;
-
- var
- i:Integer;
- r:ResTabHandle;
- Done:Boolean;
-
- begin
- GetResNum:=0;
- Done:=False;
- i:=1;
- {Get the pointer to 4BND resource}
- r:=POINTER(GetResource('4BND',CurProcResId));
- {make sure we found the resource}
- if r<> Nil then
- begin
- {Cycle thru all the entries in the}
- {4BND resource}
- while((i<=r^^.nbEntry) and
- (Not(Done))) do
- begin
- {loop until we find the one with}
- {the localID and the type we want}
- with r^^.Tab[i] do
- begin
- {check for a match}
- if (t=Typ) and
- (LocalNum=LocalId) then
- begin
- {we found it, so return the}
- {GlobalID to the calling routine}
- GetResNum:=GlobalNum;
- Done:=True;
- end; {if}
- end; {with}
- i:=i+1; {increment our entry counter}
- end; {while}
- end; {if r<>Nil}
- end; {GetResNum}
-
-